package cn.sciento.core.jackson.annotation;

import org.springframework.core.annotation.AliasFor;

import java.lang.annotation.*;

@Target({ElementType.FIELD})
@Retention(RetentionPolicy.RUNTIME)
@Documented
public @interface Sensitive {
    int left() default 0;

    int right() default 0;

    @AliasFor("cipher")
    String[] value() default {};

    @AliasFor("value")
    String[] cipher() default {};

    String[] clear() default {};

    char symbol() default '*';

    boolean reverse() default false;

    public static class Symbol {
        public static final char DEFAULT_SYMBOL = '*';

        private Symbol() throws IllegalAccessException {
            throw new IllegalAccessException();
        }
    }

    public static class Cipher {
        public static final String PHONE = "4-7";

        public static final String ID_CARD = "5-14";

        private Cipher() throws IllegalAccessException {
            throw new IllegalAccessException();
        }
    }
}
